<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

namespace App\Console\Commands;

use App\Services\HouserScoreService;
use Illuminate\Console\Command;

class CalculateHouserScore extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'calc:houser_score {--date=}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '计算每日房东分数';

    /**
     * Create a new command instance.
     */
    protected $houserScoreService;

    public function __construct(HouserScoreService $houserScoreService)
    {
        parent::__construct();
        $this->houserScoreService = $houserScoreService;
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $this->houserScoreService->calcScore();
        return 0;
    }
}
